package com.question.business.dict.model.ao;

import com.question.common.annotation.DictValid;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.List;

/**
 * 字典类型新增参数
 *
 * @author star
 * @since 2023-09-07
 */
@Data
public class DictTypeAddAO {

    /**
     * 字典类型
     */
    @NotBlank(message = "字典类型不能为空")
    @Size(max = 30, message = "字典类型最长不能超过30位")
    private String dictType;

    /**
     * 字典名称
     */
    @NotBlank(message = "字典名称不能为空")
    @Size(max = 50, message = "字典名称最长不能超过50位")
    private String dictName;

    /**
     * 启用状态(1:启用2:停用)
     */
    @DictValid(type = "enabled", message = "启用状态(1:启用2:停用)不存在")
    @NotNull(message = "启用状态(1:启用2:停用)不能为空")
    private Integer enabled;

    /**
     * 字典明细
     */
    @Size(min = 1, message = "字典明细不能为空")
    @NotNull(message = "字典明细不能为空")
    private List<DictAddAO> dictDetails;

}